package com.flats.model.dao.hibernate;

import com.flats.model.dao.Dao;
import com.flats.model.entity.Address;
import com.flats.model.entity.Persistent;
import org.hibernate.Session;
import org.hibernate.SessionFactory;


public abstract class AbstractHibernateDao<T extends Persistent> implements Dao<T> {
    private SessionFactory sessionFactory;

    protected Session getSession() {
//        return sessionFactory.openSession();
        return sessionFactory.getCurrentSession();
    }

    public void setSessionFactory(SessionFactory sessionFactory) {
        this.sessionFactory = sessionFactory;
    }
}
